/**
 * Copyright (c) 2022 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */
package io.renren.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@RestController
public class UserController {

    @GetMapping("/test")
    public String test() {
        return "test";
    }


    @GetMapping("/user")
    @PreAuthorize("hasAuthority('sys:user:info')")
    public Authentication user(Authentication authentication) {
        return authentication;
    }

}
